package com.bluefish.bltuan.interceptor;

import java.lang.reflect.Method;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;

public class BeforeInterceptor implements Interceptor {

	private BeforeExecuter executer = new BeforeExecuter();
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public void destroy() {
		
	}

	public void init() {
	
	}

	public String intercept(ActionInvocation ai) throws Exception {
		   String method = ai.getProxy().getMethod();
		   Object action = ai.getAction();
		   Method mtd = action.getClass().getMethod(method,(Class[])null);
		   this.executer.execute(action, mtd);
		   return ai.invoke();
	}

}
